package net.betou.cms.manager.assist.impl;

import java.util.List;

import net.betou.cms.dao.assist.CmsDataDao;
import net.betou.cms.entity.back.CmsConstraints;
import net.betou.cms.entity.back.CmsField;
import net.betou.cms.entity.back.CmsTable;
import net.betou.cms.manager.assist.CmsDataMng;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class CmsDataMngImpl implements CmsDataMng{

	@Transactional( readOnly = true )
	public List< CmsTable > listTabels( ) {
		return dao.listTables( );
	}

	@Transactional( readOnly = true )
	public CmsTable findTable( String tablename ) {
		return dao.findTable( tablename );
	}

	@Transactional( readOnly = true )
	public List< CmsField > listFields( String tablename ) {
		return dao.listFields( tablename );
	}

	@Transactional( readOnly = true )
	public List< CmsConstraints > listConstraints( String tablename ) {
		return dao.listConstraints( tablename );
	}

	private CmsDataDao dao;

	@Autowired
	public void setDao( CmsDataDao dao ) {
		this.dao = dao;
	}

}